from pathlib import Path 

dirs: list[str] = ['web', 'service', 'data', 'model', 'fake']
files:list[str] = ['__init__.py', 'creature.py', 'explorer.py'] 


root = Path.cwd() / 'src'

for d in dirs: 
    path = root / d 

    # 创建目录 
    path.mkdir(exist_ok=True) 

    # create file 
    for f in files: 
        file = path / f 
        
        name = f.replace('.py', '')
        # wifte content 
        if f == '__init__.py': 
            text = f'# {d}包' 
        else: 

            text = f'# {d}.{name}模块'

        file.write_text(text, encoding='utf-8')



